package com.tron.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigInteger;
import java.util.Date;

/**
 * 交易实体类
 */
@Data
@TableName(value ="transaction")
public class Transaction {

    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private Long id;

    //HASH
    @TableField(value = "hash")
    private String hash;

    //交易区块高度
    @TableField(value = "block")
    private Long block;

    //交易时间戳
    @TableField(value = "time_stamp")
    private Date timeStamp;

    //转账发起的账户地址
    @TableField(value = "from_address")
    private String fromAddress;

    //转账接收的账户地址
    @TableField(value = "to_address")
    private String toAddress;

    //货币类型 TRX 或 TRC 货币类型 (TRX=0 TRC=1)
    @TableField(value = "coin_type")
    private Integer coinType;

    //Token名字
    @TableField(value = "token_name")
    private String tokenName;

    //token类型 trc10...
    @TableField(value = "token_type")
    private String tokenType;

    //金额
    @TableField(value = "amount")
    private BigInteger amount;

    //是否确认 是否确认(0=未确认 1=已确认)
    @TableField(value = "is_confirm")
    private Integer isConfirm;

    //交易状态 SUCCESS
    @TableField(value = "contract_ret")
    private String contractRet;
}
